Bridge forwarding method and apparatus

ABSTRACT

A bridge forwarding method comprises: receiving a frame from an input port, obtaining the input VLAN ID and a destination MAC address of the frame; determining an output port and an output VLAN ID of the frame, and forwarding the frame according to the output port and the output VLAN ID. A bridge forwarding apparatus includes at least one output port used for receiving a frame from more than one VALN, at least one output port used for transmitting the frame to more than one VALN and a forwarding unit, the forwarding unit obtains the input VLAN ID and the destination MAC address in the frame, determines the output port and the output VLAN ID of the frame, and outputs the frame to the corresponding output port. The method and the apparatus of this invention can realize the bridge forwarding of the Ethernet frames between multiple VLANs.

FIELD OF THE TECHNOLOGY

The present invention relates to the network switching technical field.More particularly, the present invention relates to a bridge forwardingmethod and a bridge forwarding apparatus.

BACKGROUND OF THE INVENTION

There are two approaches for forwarding the frames of the Ethernet atpresent: Layer 2 Ethernet bridge and Layer 3 IP route. The Layer 2Ethernet bridge refers to a method for searching the Destination MediaAccess Control (MAC) address forwarding table by using the MAC addressto obtain the exit information and forwarding the data packets accordingto the exit information. The Layer 3 IP route is a method for searchingthe routing table by using the destination IP to obtain the exitinformation and forwarding the data packets according to the exitinformation. The MAC address forwarding table is obtained through theself-learning of source MAC (SMAC) address or statically configured bysoftware.

At present, as defined in the Ethernet bridge forwarding standard, oneVirtual Switching Instance (VSI) corresponds to one Virtual Local AccessNetwork (VLAN) in one access domain. The Layer 2 Ethernet bridgeforwarding is forwarding the frames within one VLAN, and if the framesneed to be forwarded between different VLANs, the forwarding must beimplemented through the Layer 3 IP routing.

FIG. 1 is a flow chart illustrating the bridge forwarding within oneVLAN in the prior art. As shown in FIG. 1, the MAC address forwardingtable is searched by using the destination MAC address and the VLANIdentifier (ID), the exit information is obtained, and the frames areforwarded according to the exit information. The main procedure ofbridge forwarding includes the following steps:

Step 101: Receiving the frame from the input port, and obtaining theinput VLAN ID of the frame.

Step 102: The self-learning of SMAC address is implemented, i.e.,recording the input port corresponding to the SMAC address in the MACaddress forwarding table corresponding to the VLAN ID.

Step 103: Searching the MAC address forwarding table corresponding tothe VLAN ID by using the destination MAC (DMAC) address obtained fromthe frame.

Step 104: If the searching result in the step 103 is the unicastforwarding, performing the step 105; if the searching result in the step103 is the multicast forwarding, performing the step 106; if thesearching result is not hit, performing the step 108.

Step 105: Searching the MAC address forwarding table to obtain theoutput port, and then proceeding to the step 110.

Step 106: Searching the MAC address forwarding table to obtain theMulticast ID (MID).

Step 107: Searching the Multicast table by using the MID to obtain a setof the output port, and then proceeding to the step 110.

Step 108: Determining to forward the frame with the broadcast mode.

Step 109: Obtaining all the output ports corresponding to the VLAN inwhich the input ports locates, and proceeding to the step 110.

Step 110: Determining whether the output port is the same as the inputport, if so, proceeding to the step 111; otherwise, proceeding to thestep 112.

Step 111: Abandoning the frames to prevent forwarding loops.

Step 112: Forwarding the frame to the output port.

The above-mentioned input port and output port correspond to one VSI,and the relationship between the VLAN and the VSI is one-to-onerelationship.

Since in one access domain, the relationship between the VLAN and theVSI is one-to-one relationship, and the multiple-to-one relationshipbetween multiple VLANs with one VSI is not supported, the Ethernetframes can only be forwarded within one VLAN by means of Layer 2Ethernet bridge forwarding. If the frames need to be forwarded acrossVLANs, the Layer 3 IP routing must be adopted. In addition, the Ethernetframes can only be broadcasted to one VLAN by means of bridgeforwarding, and broadcasting to multiple VLANs by means of bridgeforwarding is not supported.

SUMMARY OF THE INVENTION

The embodiments of present invention provide a bridge forwarding methodand a bridge forwarding apparatus to realize cross-VLAN bridgeforwarding of frames.

A bridge forwarding method includes:

obtaining an input virtual local area network (VLAN) identifier (ID) anda destination media access control (MAC) address of a frame uponreceiving the frame from an input port;

determining an output port and an output VLAN ID according to the inputport, the input VLAN ID and the destination MAC address of the frame,and forwarding the frame according to the output port and the outputVLAN ID.

According to a preferable embodiment, the method includes:

establishing relationship between one or more combinations of input portand input VLAN ID with one Virtual Switching Instance (VSI);

obtaining an input VLAN ID and a destination MAC address of a frame uponreceiving the frame from an input port;

determining the VSI corresponding to the combination of the input portand the input VLAN ID;

obtaining the output port and the output VLAN ID corresponding to thedestination MAC address through searching a MAC address forwarding tablecorresponding to the VSI.

According to another preferable embodiment of the present invention, themethod includes:

establishing relationship between one or more combinations of inputport, inner-layer VLAN ID and outer-layer VLAN ID with one VSI;

obtaining the input inner-layer VLAN ID and the input outer-layer VLANID of the frame;

determining the VSI corresponding to the combination of the input port,input inner-layer VLAN ID and input outer-layer VLAN ID;

obtain the output port, output inner-layer VLAN ID and outputouter-layer VLAN ID corresponding to the destination MAC address throughsearching the MAC address forwarding table corresponding to the VSI.

A Bridge forwarding apparatus includes:

at least one input port, for receiving a frame from more than one VLAN;

a forwarding unit, for obtaining an input VLAN ID and a destination MACaddress of the frame received from the input port, determining an outputport and an output VLAN ID according to the input port, the input VLANID and the destination MAC address of the frame, and outputting theframe;

at least one output port, for transmitting the frame to more than oneVLAN.

wherein, the forwarding unit includes:

a storing module, for storing relationship between combinations of inputport and input VLAN identifier and VSIs, as well as MAC addressforwarding tables corresponding to the VSIs, wherein at least onecombination of input port and input VLAN ID corresponds to one VSI;

an input analyzing module, for obtaining the input VLAN ID and thedestination MAC address of the frame, and outputting the input VLAN IDand the destination MAC address;

a first forwarding module, for determining the VSI corresponding to thecombination of the input port and the input VLAN ID according to therelationship between the combination of the input port and the inputVLAN ID and the VSI, and obtaining the output port and the output VLANID through searching the MAC address forwarding table corresponding tothe VSI;

a second forwarding module, for forwarding the massage according to theoutput port and the output VLAN ID obtained by the first forwardingmodule.

As can be seen from the above-mentioned technical scheme, the cross-VLANbridge forwarding of frames is realized by establishing the relationshipbetween the {Port, VLAN} and the VSI and implementing bridge forwardingof frames among different {Port, VLAN}s, and the multiple-to-onerelationship between multiple VLANs with one VSI, including one-to-onecorrespondent relationship is realized. The broadcast frames can also becopied for all the {Port, VLAN} combinations corresponding to the VSI,and the bridge broadcasting to multiple VLANs is supported.

Further, during the process of frame forwarding, whether theinput/output port is the same as the input/output VLAN ID is determined,so source port filtering can be implemented effectively to preventforwarding loops. In addition, bridge forwarding among multi-layer VLANIDs is supported by the present invention.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a flow chart illustrating the bridge forwarding of frames inthe prior art.

FIG. 2 is a flow chart illustrating the cross-VLAN bridge forwardingaccording to an embodiment of the present invention.

FIG. 3 is a flow chart illustrating the cross-VLAN bridge forwardingaccording to another embodiment of the present invention.

FIG. 4 is a schematic diagram illustrating the bridge forwardingapparatus according to an embodiment of the present invention.

DETAILED DESCRIPTION OF THE INVENTION

The present invention will be further described in detail hereinafterwith reference to the accompanying drawings to make the technicalsolution and the advantages of the present invention clearer.

The embodiments of the present invention extend the existing bridgeforwarding method within one VLAN to realize the cross-VLAN bridgeforwarding of frames. In the solution of the present invention, one VSIcorresponds to a number of doublets {port, VLAN ID}, i.e., one VSI bindsa number of doublets. Each doublet {port, VLAN ID} is regarded as avirtual port, so the bridge forwarding of frames is accomplished amongthe virtual ports.

In all the doublets corresponding to the same VSI, the relationship maybe one port corresponding to one or more VLANs, or multiple portscorresponding to one or more VLANs. The VLAN may be one or more VLANsfrom the same Ethernet port, one or more VLANs from different ports ofthe same Ethernet access network, or one or more VLANs from differentports of multiple Ethernet access networks.

Embodiment 1

FIG. 2 is a flow chart illustrating the cross-VLAN bridge forwarding. Asshown in FIG. 2, in this embodiment, the cross-VLAN bridge forwardingmethod mainly includes the steps of:

Step 201: Receiving the frame from the input port.

Step 202: Obtaining the input VLAN ID of the frame. Specifically,deciding whether the VLAN ID is carried in the frame, if so, obtainingthe VLAN ID of the frame; otherwise, obtaining the default VLAN IDrelevant to the input port, and adding the VLAN ID into the frame.

Step 203: Searching the mapping table by using the doublet {input port,input VLAN ID} to determine the corresponding VSI. Here, the VSI isrepresented by VSI ID, and the searching result is the corresponding VSIID. For sake of simplifying the description, one doublet {input port,input VLAN ID} is defined as one input virtual port.

The mapping table is established to prescribe the relationship between aset of the multiple virtual ports and one VSI, and the format of theitems in the mapping table is {port, VLAN ID, VSI ID}, and the keywordfor searching the mapping table is {port, VLAN ID}, the searching resultis the VSI ID corresponding to the virtual port.

Step 204: The self-learning of SMAC address is implemented, i.e.,recording the input port and the input VLAN ID corresponding to the SMACaddress in the MAC address forwarding table corresponding to the VSI.

Step 205: Obtaining the DMAC from the frame, and searching the MACaddress forwarding table corresponding to the VSI with the DMAC addressas the keyword, or obtaining the DMAC address and the input VLAN ID fromthe frame, and searching the MAC address forwarding table correspondingto the VSI with the DMAC address and the VLAN ID as the keywords.

For the instance of the MAC address forwarding table being notdifferentiated according to the VSI, i.e., only one MAC addressforwarding table is configured, the unified MAC address table issearched with the VSI ID and the DMAC address as the keywords, or theunified MAC address table is searched with the VSI ID, the DMAC addressand the input VLAN ID as the keywords.

Step 206: If the searching result in the Step 205 is the unicastforwarding, proceeding the step 207; if the searching result is themulticast forwarding, proceeding the step 209; if the searching resultis not hit, proceeding the step 213.

One flag bit in the item of the MAC address forwarding table is used forrepresenting unicast forwarding mode or multicast forwarding mode, sowhether the frame is forwarded with unicast or multicast mode can bedetermined according to the value of the flag bit.

Step 207: Searching the MAC address forwarding table to obtain {outputport, output VLAN ID}, for sake of simplifying the description, definingthe {output port, output VLAN ID} as the output virtual port.

Step 208: Substituting the output VLAN ID for the input VLAN ID in theframe, and proceeding to the step 217;

Step 209: Searching the MAC address forwarding table to obtain theoutput MID.

Step 210: searching the multicast table with the MID as a keyword toobtain a set of the output virtual port, i.e., {output port i, outputVLAN IDi}, wherein, i=1 . . . n, the i is the serial number of theoutput virtual ports, and the n is the total number of the obtainedoutput virtual ports after searching the multicast table;

The multicast table is established through the multicast protocol or anyother approach in the switch, and the keyword for searching themulticast table is the MID. The searching result is a set of all the{output port, output VLAN ID} corresponding to the MID.

Step 211: Copying the received frame to n copies, wherein the n is apositive integer.

Step 212: Substituting the output VLAN IDi for the input VLAN ID in theframe, proceeding to the step 217.

Step 213: If there is nothing can be found from the MAC addressforwarding table, determining to forward the frame with the broadcastmode.

Step 214: Obtaining all the output virtual ports corresponding to theVSI, i.e., {output port j, output VLAN IDj}, wherein, j=1 . . . m, the jis the serial number of the output virtual ports, and the m is the totalnumber of the output virtual ports in the broadcast mode.

All the output virtual ports corresponding to the VSI is obtained bysearching the broadcast table, and the broadcast table is alsoestablished through the multicast protocol or any other approach in theswitch. The keyword for searching the multicast table is the VSI ID, andthe searching result is a set of all the {output port, output VLAN ID}corresponding to the VSI ID.

Step 215: Copying the received frame to m copies.

Step 216: Substituting the output VLAN IDj for the input VLAN ID in theframe, proceeding to the Step 217.

Step 217: Determining whether the output virtual port is completely thesame as the input virtual port, i.e., determining whether the outputport is the same as the input port and the output VLAN ID is the same asthe input VLAN ID, if the output port is the same as the input port andthe output VLAN ID is the same as the input VLAN ID, proceeding to theStep 218; if the output port is the same as the input port while theoutput VLAN ID is not the same as the input VLAN ID, or if the outputport is not the same as the input port and the output VLAN ID is thesame as the input VLAN ID, proceeding to the Step 219.

Step 218: Abandoning the frame.

Step 219: Forwarding the frame to the output port.

The formal standard of the Virtual Bridge LAN, IEEE 802.1 Q, prescribesthat multiple logical subnet VLANs can be divided in one physical bridgeapparatus, and each VLAN corresponds to one logical forwarding table. Inpractical terms, one MAC address forwarding table is generally dividedinto multiple logical forwarding tables according to the VLAN ID. Fourbytes are added in the Ethernet frame structure, and these four bytesare called generally as the Virtual Local Access Network Tag (VLAN Tag).In these four bytes, 12 bits are used for expressing the VLAN ID.

The IEEE 802.1ad standard adds Q-in-Q and VLAN Translation based on theIEEE 802.1 Q. The Q-in-Q refers to adding one more layer of VLAN Tag forthe frame of IEEE 802.1Q in an Ethernet switch, the previous Tag of theframe is known as CE-VLAN, and the new Tag added by the operators on thePE is called P-VLAN. Employing two layers of the VLAN makes the CE-VLANused by the users and the P-VLAN used by the operators independent toeach other. The VLAN Translation refers to translating one VLAN ID toanother on a port of a bridge.

In the above-mentioned Step 208, Step 212 and Step 216, substituting theoutput VLAN ID for the VLAN ID in the frame. If the Q-in-Q servicedefined by the IEEE 802.1 ad protocol is adopted, the previous VLAN IDis reserved and a layer of new output VLAN ID is added, i.e., more 4bytes are added, and 12 bits of the 4 bytes are used for expressing theoutput VLAN ID.

In this embodiment, the process of the source port restraint can beperformed after obtaining the output virtual port and beforesubstituting the VLAN ID. For example, in the case of the unicastforwarding, after obtaining the virtual port in the Step 207,determining whether the output virtual port is completely the same asthe input virtual port, if they are completely same, abandoning theframe and ending the current flow; if they are not completely same,substituting the output VLAN ID for the VLAN ID in the frame, as said inthe Step 208.

As said in the Step 204, the MAC address forwarding table is establishedthrough self-learning, one MAC address forwarding table can beestablished in the switch, and the contents learned in connection withthe multiple VSIs are recorded in the MAC address forwarding table. Inthe MAC address forwarding table, different VSI can be differentiated byVSI ID. Alternatively, multiple MAC address forwarding tables can beestablished, and each MAC address forwarding table corresponds to oneVSI. When the SMAC address self-learning is implemented, the input portand the input VLAN ID of the frame are recorded in the MAC addressforwarding table corresponding to the VSI. The format of the items inthe MAC address forwarding table is {VSI ID, MAC address, Port, VLANID}, the keyword for searching the table is {VSI ID, DMAC} or {VSI ID,DMAC, input VLAN ID}, and the searching result is corresponding {outputport, output VLAN ID}.

In the MAC address forwarding table, the VLAN ID can be recorded orsearched indirectly through the format of the Tag Value or Tag Index.Here, the relationship between the VLAN ID and the Tag Value or the TagIndex should be established in advance. For instance, transforming thelearned VLAN ID to a Tag Value or a Tag Index according to thepre-established relationship, and records the Tag Value or the Tag Indexin the corresponding item in the MAC address forwarding table. When theoutput virtual port is found after searching the MAC address forwardingtable with a keyword, and the output VLAN ID found is expressed by theTag Value or the Tag Index, the output VALN ID can be obtained accordingto the pre-established relationship.

Embodiment 2

The Embodiment 1 describes the bridge forwarding of frames with only oneinput VLAN ID. In practical terms, however, there is more than one layerof input VLAN ID and output VLAN ID, i.e., there are two layers or morethan two layers of input VLAN ID and output VLAN ID. For example, in theapplications according to IEEE 802.1 ad standard, two layers of VLAN IDsare carried in the frame. In this kind of application environment, thereare two layers of input VLAN ID, so it possibly needs two layers ofoutput VLAN ID. In this embodiment, a number of {input port, inputouter-layer VLAN, input inner-layer VLAN} correspond to one VSI, i.e., anumber of {input port, input outer-layer VLAN, input inner-layer VLAN}is bound with one VSI.

The main procedure of bridge forwarding of frames with two layers ofinput VLAN ID and output VLAN ID is described in detail with referenceto FIG. 3.

Step 301: Receiving the frame from the input port.

Step 302: Determining whether the VLAN ID is carried in the frame, ifso, obtaining the VLAN ID including the outer-layer VLAN ID and theinner-layer VLAN ID in the frame; otherwise, obtaining the defaultouter-layer VLAN ID and the default inner-layer VLAN ID relevant to theinput port, and adds the default outer-layer VLAN ID and the defaultinner-layer VLAN ID in the frame.

Step 303: Searching the mapping table by using the input virtual port,i.e., using a triplet {input port, input VLAN ID} to determine thecorresponding VSI ID.

Step 304: The self-learning of SMAC address is implemented. That is,recording the input port, input outer-layer VLAN ID and the inputinner-layer VLAN ID corresponding to the SMAC address in the MAC addressforwarding table corresponding to the VSI.

Step 305: Obtaining the DMAC address from the frame, and searching theMAC address forwarding table corresponding to the VSI with the DMACaddress as the keyword, or searching the MAC address forwarding tablecorresponding to the VSI with the DMAC address, the input inner-layerVLAN and the input outer-layer VLAN ID as the keywords.

For the instance of the MAC address forwarding table being notdifferentiated according to the VSI, i.e., only one MAC addressforwarding table is configured, the unified MAC address forwarding tableis searched with the VSI ID and the DMAC address as the keywords, or theunified MAC address forwarding table is searched with the VSI ID, theDMAC address, and the input inner-layer VLAN and the input outer-layerVLAN ID as the keywords.

Step 306: If the searching result in the Step 305 is the unicastforwarding, proceeding to the Step 307; if the searching result is themulticast forwarding, proceeding to the Step 309; if the searchingresult is not hit, proceeding to the Step 313.

Step 307: Searching the MAC address forwarding table to obtain theoutput triplet {output port, output outer-layer VLAN ID, outputinner-layer VLAN ID}.

Step 308: Substituting the output out-layer VLAN ID for the inputouter-layer VLAN ID in the frame, proceeding to the Step 317.

Step 309: Searching the MAC address forwarding table to obtain theoutput MID.

Step 310: Searching the multicast table using the MID to obtain a set ofthe output virtual ports, i.e., {output port i, output outer-layer VLANIDi, output inner-layer VLAN IDi}, wherein, i=1 . . . n, the i is theserial number of the output virtual ports, and the n is the total numberof the output virtual ports found by searching the multicast table.

Step 311: Copying the received frame to n copies.

Step 312: Substituting the output outer-layer VLAN IDi for the inputouter-layer VLAN ID in the frame, substituting the output inner-layerVLAN IDi for the input inner-layer VLAN ID in the frame, and thenproceeding to the Step 317.

Step 313: If there is nothing can be found after searching the MACaddress forwarding table, determining that the frame is forwarded withthe broadcast mode.

Step 314: Obtaining all the output virtual ports corresponding to theVSI, i.e., {output port j, output outer-layer VLAN IDj, outputinner-layer VLAN IDj}, wherein, j=1 . . . m, the j is the serial numberof the output virtual ports, and the m is the total number of thebroadcast output virtual ports.

Step 315: Copying the received frame to m copies.

Step 316: Substituting the output outer-layer VLAN IDj for the inputouter-layer VLAN ID in the frame, substituting the output inner-layerVLAN IDj for the input inner-layer VLAN ID in the frame, and thenproceeding to the step 317.

Step 317: Determining whether the output virtual port is completely thesame as the input virtual port, i.e., determining whether the outputport, the output outer-layer VLAN ID and the output inner-layer VLAN IDare the same as the input port, the input outer-layer VLAN ID and theinput inner-layer VLAN ID respectively; if the output port, the outputouter-layer VLAN ID and the output inner-layer VLAN ID are the same asthe input port, the input outer-layer VLAN ID and the input inner-layerVLAN ID respectively, proceeding to the Step 318; otherwise, proceedingto the Step 319.

Step 318: Abandoning the frame.

Step 319: Forwarding the frame to the output port.

In summary, the present invention combines multiple {port, VLAN} s in aset, and binds the set to one VSI, then the Ethernet frame is forwardedamong the {Port, VLAN}s corresponding to the same VSI, thereby realizingthe cross-VLAN bridge forwarding of frames. The main idea of the bridgeforwarding is: obtaining the VLAN ID in the frame upon receiving theframe from the input port; determining the VSI corresponding to the{input port, input VLAN ID}; searching the {output port, output VLAN ID}corresponding to the {VSI, DMAC} in the MAC address forwarding table,and forwarding the frame according to the {output port, output VLAN ID}found after searching the table. Here, the VLAN ID can be one VLAN ID ora combination of two or multiple VALN IDs. For instance, a number of{port, outer-layer VLAN, inner-layer VLAN} and {port, VLAN} are bound toone VSI.

One layer of VLAN ID or two or more layers of VLAN ID can be obtainedfrom the inputted frame.

If there is one layer of VLAN ID, the VSI corresponding to the {inputport, input VLAN ID} is searched; if there are two layers of VLAN ID,the VSI corresponding to the {input port, input outer-layer VLAN ID,input inner-layer VLAN ID} is searched.

During the SMAC address self-learning process, the VLAN IDs obtainedfrom the frame are recorded in the MAC address forwarding table in turn.When the MAC address forwarding table is searched during the forwardingprocess, the obtained output VLAN ID can be one layer, two layers ormore layers, which is relevant to the VLAN ID recorded during the SMACaddress self-learning process.

When the frame is forwarded, the output VLAN ID of the correspondinglayer is substituted for the input VLAN ID of the corresponding layer,i.e., the output outer-layer VLAN ID is substituted for the inputouter-layer VLAN ID, and the output inner-layer VLAN ID is substitutedfor the input inner-layer VLAN ID; or the frame is forwarded to theoutput port after the output VLAN ID is added.

When the source port filtering is performed, the input port and theoutput port are compared, and the input VLAN ID and the output VLAN IDof the corresponding port are compared, if the comparison results arecompletely same, the frame is abandoned; otherwise, the frame isforwarded.

The present invention also provides a bridge forwarding apparatus, asshown in FIG. 4, the apparatus includes:

at least one input port for receiving the frame from more than one VLAN;

a forwarding unit for obtaining the input VLAN ID and the DMAC addressreceived by the input port, determining the output port and the outputVLAN ID according to the input port, input VLAN ID and the DMAC address,and then outputting the frame; and

at least one output port for transmitting the frame to more then oneVLAN;

The forwarding unit includes:

a storage module for saving the relationship between the combinations ofthe ports and the VLAN IDs with the VSIs, as well as all the MAC addressforwarding tables corresponding to the VSI, wherein, at least onecombination of the port and the VLAN ID corresponds to one VSI;

an input analyzing module for obtaining the input VLAN ID and the DMACaddress of the frame, and outputting the input VLAN ID and the DMACaddress;

a first forwarding module for determining the VSI corresponding to thecombination of the input port and the input VLAN ID according to therelationship between the combination of the port and the VLAN ID withthe VSI, then searching the MAC address forwarding table correspondingto the VSI to obtain the output port and the VLAN ID;

a second forwarding module for transmitting the massage to the outputport according to the searching result of the first forwarding module.

If the searching result of the first forwarding module is only theoutput port and the output VLAN ID, the second forwarding module isinstructed to add the output VLAN ID into the frame or substitute theoutput port for the input port in the frame before forwarding the frameto the output port.

The storage unit also saves the relationship between the multicast ID(MID) with the output port as well as the output VLAN ID.

If the searching result of the first forwarding module is the outputMID, the first forwarding module searches the multicast table using theMID to obtain a set of the output ports and the output VLAN IDs, andthis set includes N combinations of the output ports and the output VLANIDs, wherein, the N is a positive integer.

In this case, the first forwarding module instructs the secondforwarding module to copy the frame to N copies, and adds thecorresponding output VLAN in the N frames respectively or substitutesthe corresponding output VLAN IDs for the input VLAN IDs in the N copiesof frames respectively before forwarding the N frames to thecorresponding output ports.

If the searching result of the first forwarding module is nocorresponding output port and the output VLAN ID found in the MACaddress forwarding table, the M combinations of the output port and theoutput VLAN ID corresponding to the VSI are regarded as the obtainedoutput port and VLAN ID, wherein the M is a positive integer.

In this case, the first forwarding module instructs the secondforwarding module to copy the frame to M copies, and adds thecorresponding output VLAN in the M frames respectively or substitutesthe corresponding output VLAN IDs for the input VLAN IDs in the M copiesof frames respectively before forwarding the M frames to thecorresponding output ports.

Before forwarding the frame to the output port, if the second forwardingmodule detects that the output port is the same as the input port andthe output VLAN ID is the same as the input VLAN ID, abandons the frame.

The first module implements the SMAC address self-leaning, and recordsthe input port and the input VLAN ID corresponding to the SMAC addressin the MAC address forwarding table corresponding to the VSI.

The input VLAN ID includes the input inner-layer VLAN ID and the inputouter-layer VLAN ID; the output VLAN ID includes the output inner-layerVLAN ID and the output outer-layer VLAN ID

Similar to the flow shown in FIG. 3, if the VLAN ID is a two-layer VLANID, when the second forwarding module forwards the frame, substitutesthe output inner-layer VLAN ID and the output outer-layer VLAN ID forthe input inner-layer VLAN ID and the input outer-layer VLAN ID in theframe respectively. The second forwarding module detects whether theoutput VLAN ID is the same as the input VLAN ID, and when the outputinner-layer VLAN ID and the output outer-layer VLAN ID are respectivelythe same as the input inner-layer VLAN ID and the input outer-layer VLANID, it can be determined that the output VLAN ID is the same as theinput VLAN ID.

The above-mentioned partitioning of the first forwarding module and thesecond forwarding module is only for sake of simplifying thedescription. The instances hereinafter are also within the scope of thepresent invention: combining the first forwarding module and the secondforwarding module to one module; splitting the first forwarding moduleor the second forwarding module into more modules; transferring a partof the functions of the first forwarding module to the second forwardingmodule or/and transferring a part of the functions of the secondforwarding module to the first forwarding module.

The foregoing is only the preferred embodiments of the present inventionand is not intended to limit the scope of the present invention. Anymodification, equivalent substitution, or improvement made withoutdeparting from the spirit and principle of the present invention shouldbe covered by the scope set forth in the appended claims.

1. A bridge forwarding method, comprising: obtaining an input virtuallocal area network (VLAN) identifier (ID) and a destination media accesscontrol (MAC) address of a frame upon receiving the frame from an inputport; determining an output port and an output VLAN ID according to theinput port, the input VLAN ID and the destination MAC address of theframe, and transmitting the frame according to the output port and theoutput VLAN ID.
 2. The method of claim 1, further comprising:establishing relationship between one or more combinations of input portand input VLAN ID with one Virtual Switching Instance (VSI); whereinsaid determining the output port and the output VLAN ID according to theinput port, the input VLAN ID and the destination MAC address of theframe comprises: determining the VSI corresponding to the combination ofthe input port and the input VLAN ID; obtaining the output port and theoutput VLAN ID corresponding to the destination MAC address throughsearching a MAC address forwarding table corresponding to the VSI. 3.The method of claim 2, wherein said obtaining the input VLAN ID of theframe comprises: if detecting that the frame contains the VLAN ID,obtaining the VLAN ID in the frame; if detecting that the frame does notcontain the VLAN ID, obtaining a default VLAN ID relevant to the inputport, and adding the VLAN ID to the frame.
 4. The method of claim 2,wherein said MAC address forwarding table is established throughself-learning; and establishing the MAC address forwarding tablecomprises: recording a source MAC address, the input port and the inputVLAN ID in the MAC address forwarding table corresponding to the VSI. 5.The method of claim 2, wherein said searching the MAC address forwardingtable corresponding to the VSI comprises: searching the MAC addressforwarding table corresponding to the VSI with the destination MACaddress as a keyword; or searching the MAC address forwarding tablecorresponding to the VSI with the destination MAC address and the inputVLAN ID as keywords.
 6. The method of claim 2, wherein said obtainingthe output port and the output VLAN ID through searching the MAC addressforwarding table comprises: obtaining the output port and the outputVLAN ID through searching the MAC address forwarding table; saidtransmitting the frame comprises: adding the output VLAN ID in theframe, or substituting the output VLAN ID for the input VLAN ID in theframe; and transmitting the frame to the output port.
 7. The method ofclaim 2, wherein said obtaining the output port and the output VLAN IDthrough searching the MAC address forwarding table comprises: if theresult of searching the MAC address table is a multicast ID (MID),searching a multicast table with the MID as a keyword to obtain a set ofN combinations of the output port and the output VLAN ID, wherein the Nis a positive integer; said transmitting the frame comprises: copyingthe frame to N copies; adding the corresponding output VLAN ID in the Ncopies of frame respectively or substituting the corresponding outputVLAN ID for the input VLAN ID in the N copies of frame respectively; andtransmitting the N copies of frame to the corresponding output portsrespectively.
 8. The method of claim 2, wherein said obtaining theoutput port and the output VLAN ID through searching the MAC addressforwarding table comprises: if finding no corresponding output port andthe output VLAN ID in the MAC address table, M combinations of theoutput ports and the output VLAN IDs corresponding to the VSI areregarded as the found output port and the output VLAN ID, wherein the Nis a positive integer; said transmitting the frame comprises: copyingthe frame to M copies; adding the corresponding output VLAN ID in the Mcopies of frame respectively, or substituting the corresponding outputVLAN ID for the input VLAN ID in the M copies of frame respectively; andtransmitting the M copies of frame to the corresponding output ports. 9.The method of claim 2, further comprising: before the frame isforwarded, abandoning the frame if detecting that the output port is thesame as the input port and the output VLAN ID is the same as the inputVLAN ID.
 10. The method of claim 2, further comprising: establishingrelationship between the input VLAN ID obtained from the frame with aTag value or a Tag index; and recording the Tag value or the Tag indexcorresponding to the input VLAN ID in the MAC address forwarding tablecorresponding to the VSI; said obtaining the output VLAN ID throughsearching the MAC address forwarding table further comprising: searchingthe MAC address forwarding table to obtain the Tag value or the Tagindex; and obtaining the input VLAN ID according to the Tag Value or theTag.
 11. The method of claim 1, further comprising: establishingrelationship between one or more combinations of input port, inner-layerVLAN ID and outer-layer VLAN ID with one VSI; said obtaining the inputVLAN ID of the frame further comprising: obtaining the input inner-layerVLAN ID and the input outer-layer VLAN ID of the frame; said obtainingthe output port and the output VLAN ID according to the input port, theinput VLAN ID and the destination MAC address further comprising:determining the VSI corresponding to the combination of the input port,input inner-layer VLAN ID and input outer-layer VLAN ID; obtain theoutput port, output inner-layer VLAN ID and output outer-layer VLAN IDcorresponding to the destination MAC address through searching the MACaddress forwarding table corresponding to the VSI.
 12. The method ofclaim 11, wherein said MAC address forwarding table is establishedthrough self-learning; said establishing the MAC address forwardingtable comprises: recording a source MAC address, the input port, theinput inner-layer VLAN ID and the input outer-layer VLAN ID in the MACaddress table corresponding to the VSI.
 13. The method of claim 11,wherein said searching the MAC address forwarding table corresponding tothe VSI comprises: searching the MAC address forwarding tablecorresponding to the VSI with the destination MAC address as a keyword;or searching the MAC address forwarding table corresponding to the VSIwith the destination MAC address, the input inner-layer VLAN ID and theinput outer-layer VLAN ID as keywords.
 14. The method of claim 11,wherein said obtaining the output port and the output VLAN ID throughsearching the MAC address table comprises: obtaining only the outputport, output inner-layer VLAN ID and output outer-layer VLAN ID throughsearching the MAC address table; said transmitting the frame comprises:adding the output inner-layer VLAN ID and the output outer-layer ID inthe frame, or substituting the output inner-layer VLAN ID and the outputouter-layer ID for the input inner-layer VLAN ID and the inputouter-layer ID respectively; and transmitting the frame to the outputport.
 15. The method of claim 11, wherein said obtaining the output portand the output VLAN ID through searching the MAC address forwardingtable comprises: if the result of searching the MAC address forwardingtable is a MID, searching the Multicast ID with the MID as a keyword toobtain a set of N combinations of the output port, the outputinner-layer VLAN ID and the output outer-layer VLAN ID, wherein the N isa positive integer; said transmitting the frame comprises: copying theframe to N copies; adding the corresponding output inner-layer VLAN IDand output outer-layer VLAN ID in the N copies of frame respectively, orsubstituting the corresponding output inner-layer VLAN ID and outputouter-layer VLAN ID for the input inner-layer VLAN ID and inputouter-layer VLAN ID in the N copies of frame respectively; andtransmitting the N copies of frame to the corresponding output ports.16. The method of claim 11, wherein said obtaining the output port andthe output VLAN ID through searching the MAC address forwarding tablecomprises: if finding no corresponding output port and the output VLANID in the MAC address table, the M combinations of the output port, theoutput inner-layer VLAN ID and the output outer-layer VLAN IDcorresponding to the VSI are regarded as the found output port, outputinner-layer VLAN ID and output outer-layer VLAN ID; said transmittingthe frame comprises: copying the frame to M copies; adding thecorresponding output inner-layer VLAN ID and output outer-layer VLAN IDin the M copies of frame respectively, or substituting the correspondingoutput inner-layer VLAN ID and output outer-layer VLAN ID for the inputinner-layer VLAN ID and input outer-layer VLAN ID in the M copies offrame respectively; and transmitting the M copies of frame to thecorresponding output ports.
 17. The method of claim 11, furthercomprising: before the frame is transmitted, abandoning the frame ifdetecting that the output port, the output inner-layer VLAN ID and theoutput outer-layer VLAN ID are the same as the input port, the inputouter-layer VLAN ID and the input outer-layer VLAN ID respectively. 18.The method of claim 1, wherein said VLAN is one or more VLANs on thesame Ethernet port, or one or more VLANs on different ports of the sameEthernet, or one or more VLANs on different ports of more than oneEthernet.
 19. A bridge forwarding apparatus, comprising: at least oneinput port, for receiving a frame from more than one VLAN; a forwardingunit, for obtaining an input VLAN ID and a destination MAC address ofthe frame received from the input port, determining an output port andan output VLAN ID according to the input port, the input VLAN ID and thedestination MAC address of the frame, and outputting the frame; at leastone output port, for transmitting the frame to more than one VLAN. 20.The apparatus of claim 19, wherein said forwarding unit comprises: astoring module, for storing relationship between combinations of inputport and input VLAN identifier and VSIs, as well as MAC addressforwarding tables corresponding to the VSIs, wherein at least onecombination of input port and input VLAN ID corresponds to one VSI; aninput analyzing module, for obtaining the input VLAN ID and thedestination MAC address of the frame, and outputting the input VLAN IDand the destination MAC address; a first forwarding module, fordetermining the VSI corresponding to the combination of the input portand the input VLAN ID according to the relationship between thecombination of the input port and the input VLAN ID and the VSI, andobtaining the output port and the output VLAN ID through searching theMAC address forwarding table corresponding to the VSI; a secondforwarding module, for forwarding the massage according to the outputport and the output VLAN ID obtained by the first forwarding module. 21.The apparatus of claim 20, wherein, when said first forwarding moduleobtains only the output port and the output VLAN ID through searchingthe MAC address forwarding table, instructs the second forwarding moduleto forward the frame after adding the output VLAN ID in the frame orsubstitutes the output VLAN ID for the input VLAN ID in the frame. 22.The apparatus of claim 20, wherein said storing unit also storesrelationship between multicast IDs (MID) and combinations of output portand output VLAN ID; when obtaining the MID after searching the MACaddress forwarding table, the first forwarding module searches amulticast table with the MID as a keyword to obtain a set of Ncombinations of the output port and the output VLAN ID, wherein the N isa positive integer; said first forwarding module instructs the secondforwarding module to copy the frame to N copies, adds the correspondingoutput VLAN in the N frames respectively, or substitutes thecorresponding output VLAN IDs for the input VLAN IDs in the N copies offrame respectively, and forwards the N frames to the correspondingoutput ports.
 23. The apparatus of claim 20, wherein if finding nocorresponding output port and the output VLAN ID in the MAC addressforwarding table, the first forwarding module taking the combination ofthe M output ports and the M output VLAN IDs corresponding to the VSI asthe obtained output port and VLAN ID, wherein the M is a positiveinteger; said first forwarding module instructs the second forwardingmodule to copy the frame to M copies, adds the corresponding output VLANin the M frames respectively, or substitutes the corresponding outputVLAN IDs for the input VLAN IDs in the M copies of frame respectively,and forwards the M frames to the corresponding output ports.
 24. Theapparatus of claim 20, wherein said second forwarding module is alsoused for detecting whether the output port, the output VLAN ID are thesame as the input port and the input VLAN ID respectively beforeforwarding the frame to the output port, and abandoning the frame inwhich the output port and the output VLAN ID are the same as the inputport and the input VLAN ID respectively.
 25. The apparatus of claim 20,wherein said first forwarding module is also used for implementingsource MAC self-learning, and recording the input port and the inputVLAN ID corresponding to the VSI in the MAC address forwarding table.26. The apparatus of claim 19, wherein said input VLAN ID comprises aninput inner-layer VLAN ID and an input outer-layer VLAN ID; said outputVLAN ID comprises an output inner-layer VLAN ID and an outputouter-layer VLAN ID.